package com.maserb.monitor.entity.schoolStudent;

import com.maserb.monitor.entity.BaseIdEntity;
import com.maserb.monitor.entity.SysCode;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

/**
 * 考试分数
 *  @author  jimmy
 */
@Data
@Entity
@Table(name = "student_score")
public class StudentScoreEntity extends BaseIdEntity implements java.io.Serializable {
    /**
     * 科目
     */
    private SysCode subject;

    /**
     * 成绩
     */
    private StudentAchieveEntity achieve;

    /**
     * 分数
     */
    private double score;

    /**
     * 描述
     */
    private String description;

    private Date createTime;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "subject_id")
    public SysCode getSubject() {
        return subject;
    }

    public void setSubject(SysCode subject) {
        this.subject = subject;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "achieve_id")
    public StudentAchieveEntity getAchieve() {
        return achieve;
    }

    public void setAchieve(StudentAchieveEntity achieve) {
        this.achieve = achieve;
    }

    @Column(name = "score")
    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
}